<!--------------------------------------------------------------
>//	Company:	HTHK
>//	NAME:	    JobReport.jsp
>//	TITLE:	    Monthly Jobs Report by Project
>//	FUNCTION:	Report Monthly Jobs by Project
>//	BY:	        Mike Cheng
>//	DATE:	    15/1/2003
>// --------------------------------------------------------------
>// MODIFICATION HISTORY
>// --------------------------------------------------------------
>//	CR Log #:  99999  BY:  XXXX   DATE:  dd/mm/yyyy
>//	ERROR:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>//	FIX:	XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
>// --------------------------------------------------------------
-->

<html>
<%@ include file="../tssheader.jsp" %>
<%@ page import="tss.options.*" %>
<%@ page import="tss.jobreport.*" %>
<body>
<%   
//------------------ Update By Beyes Xia ---------------------------------// 
	String exportType = request.getParameter("export_type");
	System.out.println("export_type:"+exportType);
     if (exportType.equals("excel"))
     {
     	System.out.println();
		 response.setContentType("application/vnd.ms-excel");
//		 response.setHeader("Content-Disposition", "attachment; filename="+"JobReport.xls");
	 }
//---------------- 4/29/2004 11:52AM ------------------------------------//	 
        Vector jobvec = (Vector)request.getAttribute("jobvec");
        Vector year_month = (Vector)request.getAttribute("year_month");


        //System.out.println("jobvec length is "+jobvec.size());        
	ChangeNum num = new ChangeNum();

	String company_code = "";
	company_code = request.getParameter("company_code");
%>

<body >
<h2>Monthly Jobs Report by Project</h2>
<table>
<tr>
	<td>Company: </td>
	<td><%=company_code%></td>
</tr>
</table>
<%
for (int i=0; i<jobvec.size(); i++)
{
    ReportContainer l_rptCont = (ReportContainer)jobvec.get(i);
    String[] str_year_month = new String[3];
    str_year_month = (String[])year_month.get(i);
 %>
<br>
<table>
<tr>
	<td>Month: </td>
	<td><%=str_year_month[0]%></td>
</tr>
<tr>
        <td>Day From: </td>
        <td><%=str_year_month[1]%></td>
        <td>To: </td>
        <td><%=str_year_month[2]%></td>
</tr>
</table>

<table border=1>
<thead>
	<td><b>Project Name</b></td>
        <td><b>Project Description</b></td>
        <td><b>Hours</b></td>
        <td><b>Hours%</b></td>
</thead>

<%
    Vector projectsVec =  l_rptCont.getProjects();
    //System.out.println("i = " + i + ", projectsVec length is " + projectsVec.size());
    for (int j=0; j<projectsVec.size(); j++)
    {
        String[] rptColumn = (String[])projectsVec.get(j);
 %>
 
<tr>
    <td><%=rptColumn[0]%></td>
    <td><%=(rptColumn[1].equals(" ")?"&nbsp;":rptColumn[1])%></td>
	<td align=right><%=num.getFixNum(rptColumn[2],2)%></td>
	<td align=right><%=num.getFixNum(rptColumn[3],2)%>%</td>
</tr>
<%    }%>
</table>
<%}%>
<br>
<hr>
<p>
<INPUT type=button value=Back onclick="location.href='<%=contextPath%>/tss/jobreport/JobExport.jsp'">
</p>
<%
//     if (exportType.equals("web"))
//     {
//     	System.out.println("xxmm");  	
%>
<%
//		System.out.println("xxmm1");
//	 }
%>	 
</body> 
<%@ include file="../tssfooter.jsp" %>
</body>
</html>
